<?php
//PLUGIN type=action
//PLUGIN name=user.delete
//PLUGIN desc=Enables you to delete users
//PLUGIN group=native

$userlist = unserialize(file_get_contents(_SETTINGSPATH_."/userdata.ser"));


    if(!empty($options['user'])) {
        // delete this user
        if(isset($userlist[$options['user']])) { // if user exists
            if($userlist[$options['user']]['deleteable']) {// If user is deleteable
                unset ($userlist[$options['user']]); // delete user from array
                file_put_contents(_SETTINGSPATH_."/userdata.ser", serialize($userlist)); // and save it
            }
        }
    }
    header("Location:?q=command:cms;view:cms.users;");



?>